<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var myarr = [11,22,33,44,55,66,11,11,44,55,22]

        // 方法一
        // function quchong(arr) {
        //     var karr = []
        //     for (let i = 0; i < arr.length; i++) {
        //         if(karr.indexOf(arr[i]) === -1){
        //             karr.push(arr[i])
        //         }
        //     }
        //     return karr
        // }
        // var req = quchong(myarr)
        // console.log(req)
        // 方法二
        var karr = [...myarr]
        console.log(karr)
        const unique = Array.from(new Set(myarr))
        console.log(unique)
    </script>
</body>
</html>